/*
 * Copyright (c) 2018 Tencent. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
const AbstractModel = require("../../common/abstract_model");

/**
 * Region management system product information.
 * @class
 */
class RegionProduct extends  AbstractModel {
    constructor(){
        super();

        /**
         * Product name, for example cvm.
         * @type {string || null}
         */
        this.Name = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Name = 'Name' in params ? params.Name : null;

    }
}

/**
 * DescribeProducts request structure.
 * @class
 */
class DescribeProductsRequest extends  AbstractModel {
    constructor(){
        super();

        /**
         * Number of returned results, defaults to 20, maximum value is 100.
         * @type {number || null}
         */
        this.Limit = null;

        /**
         * Offset. default value: 0.
         * @type {number || null}
         */
        this.Offset = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Limit = 'Limit' in params ? params.Limit : null;
        this.Offset = 'Offset' in params ? params.Offset : null;

    }
}

/**
 * DescribeProducts response structure.
 * @class
 */
class DescribeProductsResponse extends  AbstractModel {
    constructor(){
        super();

        /**
         * Product detailed information list.
         * @type {Array.<RegionProduct> || null}
         */
        this.Products = null;

        /**
         * Total number of products.
         * @type {number || null}
         */
        this.TotalCount = null;

        /**
         * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
         * @type {string || null}
         */
        this.RequestId = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }

        if (params.Products) {
            this.Products = new Array();
            for (let z in params.Products) {
                let obj = new RegionProduct();
                obj.deserialize(params.Products[z]);
                this.Products.push(obj);
            }
        }
        this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;
        this.RequestId = 'RequestId' in params ? params.RequestId : null;

    }
}

/**
 * Availability zone information
 * @class
 */
class ZoneInfo extends  AbstractModel {
    constructor(){
        super();

        /**
         * Availability zone name, for example, ap-guangzhou-3.

The names of availability zones across the network are as follows:.
<li> ap-chongqing-1 </li>
<li> ap-seoul-1 </li>
<li> ap-seoul-2 </li>
<li> ap-chengdu-1 </li>
<li> ap-chengdu-2 </li>
<li> ap-hongkong-1 </li>
<li> ap-hongkong-2 </li>
<li> ap-shenzhen-fsi-1 </li>
<li> ap-shenzhen-fsi-2 </li>
<li> ap-shenzhen-fsi-3 </li>
<Li> ap-guangzhou-1 (sold-out)</li>.
<Li> ap-guangzhou-2 (resource out of stock)</li>.
<li> ap-guangzhou-3 </li>
<li> ap-guangzhou-4 </li>
<li> ap-guangzhou-6 </li>
<li> ap-tokyo-1 </li>
<li> ap-singapore-1 </li>
<li> ap-singapore-2 </li>
<li> ap-shanghai-fsi-1 </li>
<li> ap-shanghai-fsi-2 </li>
<li> ap-shanghai-fsi-3 </li>
<li> ap-bangkok-1 </li>
<Li> ap-shanghai-1 (resource out of stock) </li>.
<li> ap-shanghai-2 </li>
<li> ap-shanghai-3 </li>
<li> ap-shanghai-4 </li>
<li> ap-shanghai-5 </li>
<li> ap-mumbai-1 </li>
<li> ap-mumbai-2 </li>
<li> ap-beijing-1 </li>
<li> ap-beijing-2 </li>
<li> ap-beijing-3 </li>
<li> ap-beijing-4 </li>
<li> ap-beijing-5 </li>
<li> na-siliconvalley-1 </li>
<li> na-siliconvalley-2 </li>
<li> eu-frankfurt-1 </li>
<li> na-ashburn-1 </li>
<li> na-ashburn-2 </li>
<li> ap-nanjing-1 </li>
<li> ap-nanjing-2 </li>
         * @type {string || null}
         */
        this.Zone = null;

        /**
         * Availability zone description, such as Guangzhou Zone 3.
         * @type {string || null}
         */
        this.ZoneName = null;

        /**
         * AZ ID
         * @type {string || null}
         */
        this.ZoneId = null;

        /**
         * Availability zone status, including AVAILABLE and UNAVAILABLE. AVAILABLE indicates available, and UNAVAILABLE indicates unavailable.
         * @type {string || null}
         */
        this.ZoneState = null;

        /**
         * Parent zone.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.ParentZone = null;

        /**
         * Parent availability zone ID.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.ParentZoneId = null;

        /**
         * Describes the parent availability zone.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.ParentZoneName = null;

        /**
         * zone type.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.ZoneType = null;

        /**
         * Console type.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.MachineRoomTypeMC = null;

        /**
         * Same as ZoneId. suitable for console invocation.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.ZoneIdMC = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Zone = 'Zone' in params ? params.Zone : null;
        this.ZoneName = 'ZoneName' in params ? params.ZoneName : null;
        this.ZoneId = 'ZoneId' in params ? params.ZoneId : null;
        this.ZoneState = 'ZoneState' in params ? params.ZoneState : null;
        this.ParentZone = 'ParentZone' in params ? params.ParentZone : null;
        this.ParentZoneId = 'ParentZoneId' in params ? params.ParentZoneId : null;
        this.ParentZoneName = 'ParentZoneName' in params ? params.ParentZoneName : null;
        this.ZoneType = 'ZoneType' in params ? params.ZoneType : null;
        this.MachineRoomTypeMC = 'MachineRoomTypeMC' in params ? params.MachineRoomTypeMC : null;
        this.ZoneIdMC = 'ZoneIdMC' in params ? params.ZoneIdMC : null;

    }
}

/**
 * DescribeZones request structure.
 * @class
 */
class DescribeZonesRequest extends  AbstractModel {
    constructor(){
        super();

        /**
         * Name of the product to be queried, such as cvm. for specific value, query the DescribeProducts api.
         * @type {string || null}
         */
        this.Product = null;

        /**
         * No input or 0 means no query [optional business allowlist], 1 means query [optional business allowlist]. if this parameter is set to 1, the allowlist will only be queried when no result is found in the business allowlist.
         * @type {number || null}
         */
        this.Scene = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Product = 'Product' in params ? params.Product : null;
        this.Scene = 'Scene' in params ? params.Scene : null;

    }
}

/**
 * DescribeZones response structure.
 * @class
 */
class DescribeZonesResponse extends  AbstractModel {
    constructor(){
        super();

        /**
         * Number of availability zones.
         * @type {number || null}
         */
        this.TotalCount = null;

        /**
         * Availability zone list information.
         * @type {Array.<ZoneInfo> || null}
         */
        this.ZoneSet = null;

        /**
         * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
         * @type {string || null}
         */
        this.RequestId = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;

        if (params.ZoneSet) {
            this.ZoneSet = new Array();
            for (let z in params.ZoneSet) {
                let obj = new ZoneInfo();
                obj.deserialize(params.ZoneSet[z]);
                this.ZoneSet.push(obj);
            }
        }
        this.RequestId = 'RequestId' in params ? params.RequestId : null;

    }
}

/**
 * Region information
 * @class
 */
class RegionInfo extends  AbstractModel {
    constructor(){
        super();

        /**
         * Region name, such as ap-guangzhou.
         * @type {string || null}
         */
        this.Region = null;

        /**
         * Region description, for example, South China (Guangzhou).
         * @type {string || null}
         */
        this.RegionName = null;

        /**
         * Whether the region is in an available state.
         * @type {string || null}
         */
        this.RegionState = null;

        /**
         * Console type. defaults to null when called via api.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {number || null}
         */
        this.RegionTypeMC = null;

        /**
         * Region for different languages.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.LocationMC = null;

        /**
         * Region description on console display.
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.RegionNameMC = null;

        /**
         * 1
Note: This field may return null, indicating that no valid values can be obtained.
         * @type {string || null}
         */
        this.RegionIdMC = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Region = 'Region' in params ? params.Region : null;
        this.RegionName = 'RegionName' in params ? params.RegionName : null;
        this.RegionState = 'RegionState' in params ? params.RegionState : null;
        this.RegionTypeMC = 'RegionTypeMC' in params ? params.RegionTypeMC : null;
        this.LocationMC = 'LocationMC' in params ? params.LocationMC : null;
        this.RegionNameMC = 'RegionNameMC' in params ? params.RegionNameMC : null;
        this.RegionIdMC = 'RegionIdMC' in params ? params.RegionIdMC : null;

    }
}

/**
 * DescribeRegions response structure.
 * @class
 */
class DescribeRegionsResponse extends  AbstractModel {
    constructor(){
        super();

        /**
         * Number of Regions
         * @type {number || null}
         */
        this.TotalCount = null;

        /**
         * List Information of Region
         * @type {Array.<RegionInfo> || null}
         */
        this.RegionSet = null;

        /**
         * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.
         * @type {string || null}
         */
        this.RequestId = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.TotalCount = 'TotalCount' in params ? params.TotalCount : null;

        if (params.RegionSet) {
            this.RegionSet = new Array();
            for (let z in params.RegionSet) {
                let obj = new RegionInfo();
                obj.deserialize(params.RegionSet[z]);
                this.RegionSet.push(obj);
            }
        }
        this.RequestId = 'RequestId' in params ? params.RequestId : null;

    }
}

/**
 * DescribeRegions request structure.
 * @class
 */
class DescribeRegionsRequest extends  AbstractModel {
    constructor(){
        super();

        /**
         * Name of the product to be queried, such as cvm. for specific value, query the DescribeProducts api.
         * @type {string || null}
         */
        this.Product = null;

        /**
         * Not passed or 0 means no query [optional business allowlist], 1 means query [optional business allowlist]. if this parameter is set to 1, the allowlist will only be queried when no business allowlist is found.
         * @type {number || null}
         */
        this.Scene = null;

    }

    /**
     * @private
     */
    deserialize(params) {
        if (!params) {
            return;
        }
        this.Product = 'Product' in params ? params.Product : null;
        this.Scene = 'Scene' in params ? params.Scene : null;

    }
}

module.exports = {
    RegionProduct: RegionProduct,
    DescribeProductsRequest: DescribeProductsRequest,
    DescribeProductsResponse: DescribeProductsResponse,
    ZoneInfo: ZoneInfo,
    DescribeZonesRequest: DescribeZonesRequest,
    DescribeZonesResponse: DescribeZonesResponse,
    RegionInfo: RegionInfo,
    DescribeRegionsResponse: DescribeRegionsResponse,
    DescribeRegionsRequest: DescribeRegionsRequest,

}
